#include <iostream>
#include <cstring>
#include "String.h"
using std::cout;
using std::cin;
using std::endl;

void testUnit1(){
    String* s1 = new String("peking");
    delete s1;


    String s2("hello");
    String s3(s2);
    s3.print();
}


void testUnit2(){
    String s1("goodbye");
    String s2("world");

    s1 = "tsinghua";
    s1.print();
}

void testUnit3(){
    String s1("abcdefg");
    s1[3] = 'C';
    cout << s1[3] << endl;
}

void testUnit4(){
    String s1("hello");
    String s2("world");

//    s1 += s2;
//    s1 += "!!!!!";
    s1 += s1;
    s1.print();
}

void testUnit5(){
    String s1 = "hello";
    String s2 = "hello1";
    cout << (s1 != s2) << endl;
}

// BUG
void testUnit6(){
    String s1("hello");
    cout << s1 << endl;

    String s2;
    cin >> s2;
    cout << s2 << endl;
}

void testUnit7(){
    String s1("abcdg");
    String s2("abcdf");
    cout << (s1 > s2) << endl;
}

void testUnit8(){
    String s1("abcdg");
    String s2("abcdf");
    cout << (s1 > s2) << endl;
}

void testUnit9(){
    String s1("abcdf");
    String s2("abcdfh");
    cout << (s1 >= s2) << endl;
}

void testUnit10(){
    String s1("hello");
    String s2("world");
//    cout << s1+s2 << endl;

    const char *s = "逆天";
    cout << s + s1 << endl;
    cout << s1 + s << endl;
}
int main() {
    testUnit6();

    return 0;
}
